package com.freewater.springboot.demo.aop.apectj.injectdomain;

import com.freewater.springboot.demo.aop.apectj.injectdomain.domain.Account;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

// 需要在idea运行参数配置jvm参数：
// -javaagent:path-to-spring-instrument.jar
public class Main {
    public static void main(String[] args) {
        final AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(AppConfig.class);
        applicationContext.registerShutdownHook();
        //
        Account account1 = new Account("123", "zhangsan");
        System.out.println(account1.getAuthContext());
        System.out.println(account1.getAccountRepository());
        //
        Account account2 = new Account("456", "lisi");
        System.out.println(account2.getAuthContext());
        System.out.println(account2.getAccountRepository());
    }
}
